package ${packageName};

import com.zxn.presenter.view.BaseActivity;
import android.os.Bundle;
import android.content.Context;
import android.content.Intent;
<#if applicationPackage??>
import ${applicationPackage}.R;
</#if>
<#if includeCppSupport!false>
</#if>
/**
 *	
 * Created by zxn on ${.now}.
 */
public class ${activityClass} extends BaseActivity {

    private static final String ARG_PARAM1 = "param1";
    private String mParam1;

    @BindView(R.id.ctl_menu)
    CommonTabLayout ctlMenu;
	
	public static void jumpTo(Context context,String param1) {
        Intent intent = new Intent(context, ${activityClass}.class);
        intent.putExtra(ARG_PARAM1, param1);
        context.startActivity(intent);
    }

    public static void jumpTo(Context context) {
        Intent intent = new Intent(context, ${activityClass}.class);
        context.startActivity(intent);
    }

    @Override
    protected int getLayoutResId() {
        return R.layout.${layoutName};
    } 
    

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
		mParam1 = getIntent().getStringExtra(ARG_PARAM1);

		onInitView();	
    }

    private void onInitView() {
        ArrayList<CustomTabEntity> mTabEntities = new ArrayList<>();
        String[] mTitles = {"tab0","tab1", "tab2", "tab3"};
        int[] mIconUnselectIds = {R.drawable.ic_tab0_off,
        	R.drawable.ic_tab1_off,
        	R.drawable.ic_tab2_off,
        	R.drawable.ic_tab3_off};
    	int[] mIconSelectIds = {R.drawable.ic_tab0_on,
    		R.drawable.ic_tab1_on,
    		R.drawable.ic_tab2_on,
    		R.drawable.ic_tab3_on};
        for (int i = 0; i < mTitles.length; i++) {
            mTabEntities.add(new TabEntity(mTitles[i], mIconSelectIds[i], mIconUnselectIds[i]));
        }
        ArrayList<Fragment> fragments = new ArrayList<>();
        //homeFrag = HomeFrag.newInstance();
        //fragments.add(homeFrag);
        ctlMenu.setTabData(mTabEntities, this, R.id.fl_content, fragments);
        ctlMenu.setOnTabSelectListener(new OnTabSelectListener() {
            @Override
            public void onTabSelect(int position) {

            }

            @Override
            public void onTabReselect(int position) {

            }
        });
        ctlMenu.setCurrentTab(0);
    }
}
